from tkinter import *
import requests
import json
import ast
def dfe():
    textx=tt.get()
    #content = requests.get("https://api.ashcon.app/mojang/v2/user/"+textx)

    content = requests.get("http://api.tianapi.com/ncov/index?key=3e1aa323b54024beed748d9a747c0d5b")
    print(content.json())
    c = content.json()
    print(c["newslist"][0]["news"][0]["summary"])
    # print(content.content.decode("utf-8"))
    #comtent = content.json()
    #print(comtent)
    # print("uuid:",comtent["uuid"])
    # print("名字:",comtent["username_history"][0])
    # print("皮肤:",comtent["textures"]["skin"]["url"])
    # print(comtent)

a = Tk()
a.title('test')
a.geometry("500x200")

tt = Entry(a)
tt.grid(row=0,column=1)



buttonx=Button(a,text="确定",font=("宋体",30),command=dfe)

buttonx.grid(row=1,column=2)



a.mainloop()